package com.example.demo.controller.dto;

import com.example.demo.model.User;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * Created by xdkxlk on 2017/8/11.
 */
@Data
public class UserAuthDTO extends UserDTO {

    private String token;

    public static UserAuthDTO convertFor(User user){
        UserAuthDTO userAuthDTO = new UserAuthDTO();

        BeanUtils.copyProperties(user, userAuthDTO);

        return userAuthDTO;
    }
}
